<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>库存变化查询</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<jsp:include page="../common/easyui.jsp"></jsp:include>
	<script type="text/javascript">
	
	$(function(){
		$('#rs').datagrid({
				iconCls:'icon-save',
				height:320,
				pagination:true,
				rownumbers:true,
				autoRowHeight: false,
				striped: true,
				collapsible:true,
				url:'stockAction!getList.action',
				singleSelect:true,
				fitColumns:false,
				columns:[[
					{field:'posName',title:'网点名称 ',width:140},
					{field:'operName',title:'操作员',width:140},
					{field:'str_OpTime',title:'操作时间',width:140},
					{field:'opType',title:'操作类型',width:100,
					 formatter: function(value,row,index){
				                      if (row.opType==3){
					                   	return '入库';
			                           } else if(row.opType==4)
			                           {
				                        return '出库';
			                           }
			                                            }
					},
					{field:'inv',title:'票据批次',width:100},
					{field:'invStart',title:'票据起号',width:140},
					{field:'invEnd',title:'票据止号',width:140},
					{field:'invCnt',title:'票据数量',width:140}
				]]
				});
		});
		 function doSearch(){ 
		 var ddl = document.getElementById("orgID");
		 var Value =ddl.options[ddl.selectedIndex].value;
		 $('#rs').datagrid('load',{    
          orgID: Value,
          OpType:   $('#OpType').combobox('getValue') ,
          start: $('#start').datebox('getValue') ,
          end: $('#end').datebox('getValue') 
        });    
 	 }  
	</script>

  </head>
  
  <body>
  <div id="searchDiv" class="easyui-panel"  title="库存变化查询——查询条件" style="background-color:#EBF2FF;" collapsible="true">
		<form id="searchForm" method="post" style="margin-top:10px" action="">
	           <table >
					<tr>
						<td width="5%" align="right">
							<div style="font-family:微软雅黑;font-size:12px;">机构名称:</div>
						</td>
						<td>
		 				<select name="orgID" id="orgID">
		 				<s:iterator value="termList" id="posorg">
		 				<option value="<s:property value="#posorg.PosID"/>" <s:if test="#posorg.PosID==orgID" >selected="selected"</s:if> >
		 				<s:property value="#posorg.PosName"/></option>
		 				</s:iterator>
		 				</select>
						</td>
						<td>变化类型</td>
						<td><select id="OpType" class="easyui-combobox" name="OpType" style="width:80px;">
    						<option value="4">出库</option>
    						<option value="3">入库</option>
							</select>
						</td>
						<td>时间：</td>
						<td>
						<input class="easyui-datebox" type="text" id="start" name="start" style="width:200px;border:1px solid #ccc" />至
						<input class="easyui-datebox" type="text" id="end" name="end" style="width:200px;border:1px solid #ccc" /></td>
					   </tr>
					</table>
					<div align="center">
					<table >
					<tr></tr>
					<tr></tr>
					<tr>
						<td colspan="2" width="20%" >
							<table align="center">
								<tr>
									<td width="10%" align="center"> <a href="javascript:void(0)"  class="easyui-linkbutton" iconCls="icon-search"  onclick="doSearch()">查询</a>
									<a href="javascript:void(0)"  class="easyui-linkbutton" iconCls="icon-redo" onclick="$('#searchForm')[0].reset();" >重置</a>
                                    </td>   
								</tr>
							</table>
						</td>						
					</tr>
				</table>     
				</div>
		 </form>
	</div>
     <div id="birt" class="easyui-panel"  title="查询结果" style="background-color:#EBF2FF;height: 460"  collapsible="true">
	<table id="rs" style="width:auto;overflow:auto" > </table>
	 </div>
  </body>
</html>
